package com.bouncing.ball;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;



public class Ball {
	private int xCoord, yCoord, radius, xVel, yVel, id;
	private int color;
	private Bitmap img;

	public void setxCoord(int a)
	{
		a = xCoord;
	}
	public void setyCoord(int a)
	{
		a = yCoord;
	}
	public void setxVel(int a)
	{
		a = xVel;
	}
	public void setyVel(int a)
	{
		a = yVel;
	}
	public void setradius(int a)
	{
		a = radius;
	}
	public void setcolor(int a)
	{
		a = color;
	}
	public void setid(int a)
	{
		a = id;
	}
	public int getid()
	{
		return id;
	}
	public int getxCoord()
	{
		return xCoord;
	}
	public int getyCoord()
	{
		return yCoord;
	}
	public int getxVel()
	{
		return xVel;
	}
	public int getyVel()
	{
		return yVel;
	}
	public int getradius()
	{
		return radius;
	}
	public int getcolor()
	{
		return color;
	}

	public Ball(int xCoord, int yCoord, int xVel, int yVel, int radius, int color, Context context, int Drawable)
	{
		BitmapFactory.Options ops = new BitmapFactory.Options();
		ops.inJustDecodeBounds = true;
		img = BitmapFactory.decodeResource(context.getResources(), Drawable);
		this.xCoord = xCoord;
		this.yCoord = yCoord;
		this.xVel = xVel;
		this.yVel = yVel;
		this.radius = radius;
		this.color = color;

	}

	public Bitmap getImage(){
		return img;
	}

	//Collision
	public void move(Ball subject)
	{
		xCoord += xVel;
		yCoord += yVel;
		if((xCoord + 62) >= 472 || xCoord <= 0)
		{
			xVel = -xVel;
		}
		if((yCoord + 62) >= 725 || yCoord <= 0)
		{
			yVel = -yVel;
		}
	}
}
